package com.atguigu08._interface.ex2;

public class ComparableCircle extends Circle implements CompareObject{
    public ComparableCircle(int radius) {
        super(radius);
    }

    @Override
    public int compareTo(Object o) {
        if(o instanceof Circle){
            Circle circle=(Circle)o;
            if (circle.getRadius()<this.getRadius()){
                return 1;
            }
            if (circle.getRadius()>this.getRadius()){
                return -1;
            }
        }

        return 0;
    }
}
